using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Jbe.TestSuite.Infrastructure.Shell.Properties;

namespace Jbe.TestSuite.Infrastructure.Shell
{
    public enum MessageType 
    {
        Information,
        Warning,
        Error
    }

    public partial class MessageForm : Form
    {
        private MessageType messageType;

        public MessageType MessageType
        {
            get { return messageType; }
            set 
            { 
                messageType = value;
                switch (messageType)
                {
                    case MessageType.Information:
                        picture.Image = Resources.Information.ToBitmap();
                        break;
                    case MessageType.Warning:
                        picture.Image = Resources.Warning.ToBitmap();
                        break;
                    case MessageType.Error:
                        picture.Image = Resources.Error.ToBitmap();
                        break;
                }
            }
        }

        public string Message
        {
            get { return message.Text; }
            set { message.Text = value; }
        }

        public string Details
        {
            get { return detailsText.Text; }
            set { detailsText.Text = value; }
        }

        public MessageForm()
        {
            InitializeComponent();
            Text = Application.ProductName;
        }

        private void CopyInfoButtonClick(object sender, EventArgs e)
        {
            Clipboard.SetText(Message + Environment.NewLine + Environment.NewLine + Details, TextDataFormat.UnicodeText);
        }

        private void OKButtonClick(object sender, EventArgs e)
        {
            Close();
        }
    }
}